﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class NewCatch_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //XGXTCatch c = new XGXTCatch();
        //c.Import();
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        BBSDataCatch c = new BBSDataCatch();
        c.Import();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        YwCatch2 c = new YwCatch2();
        c.Import();
    }
    protected void btnaa_Click(object sender, EventArgs e)
    {
        GsxwCatch c = new GsxwCatch();
        c.Import();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        GsxwCatch2 c = new GsxwCatch2();
        c.Import();
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        ZhuliCatch c = new ZhuliCatch();
        c.Import();
    }

    protected void Button5_Click(object sender, EventArgs e)
    {
        BkfxCatch c = new BkfxCatch();
        c.Import();
    }
    protected void Button6_Click(object sender, EventArgs e)
    {
        GeguCatch c = new GeguCatch();
        c.Import();
    }
    protected void Button7_Click(object sender, EventArgs e)
    {
        new DpfxCatch().Import();
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        new BBSDataCatch().Import();
    }
    protected void Button8_Click(object sender, EventArgs e)
    {
        HzhbCatch c = new HzhbCatch();
        try
        {
            //获取数据地址和typeid            
            string str_xml = HttpContext.Current.Server.MapPath("~/NewCatch/Hzhb.xml");
            DataSet ds = new DataSet();
            //从xml中读取数据
            ds.ReadXml(str_xml);
            if (ds != null)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    string url = ds.Tables[0].Rows[i][1].ToString();
                    string typeid = ds.Tables[0].Rows[i][0].ToString();
                    if (!string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(typeid))                    
                    {
                        c.Import(url, typeid);
                    }
                }
            }
        }
        catch
        { }
        
        
    }
}